import {BaseEntity, Column, Entity, Index, JoinColumn, JoinTable, ManyToMany, ManyToOne, OneToMany, OneToOne, PrimaryColumn, PrimaryGeneratedColumn, RelationId} from 'typeorm';

@Entity('fa_cms_channel', {schema: 'fastadmin' } )
@Index('diyname', ['diyname' ], {unique: true})
@Index('weigh', ['weigh', 'id' ])
@Index('parent_id', ['parent_id' ])
export class fa_cms_channel {

    @PrimaryGeneratedColumn({
        type: 'int',
        name: 'id',
        })
    id: number;

    @Column('enum', {
        nullable: false,
        enum: ['channel', 'page', 'link', 'list'],
        name: 'type',
        })
    type: string;

    @Column('int', {
        nullable: false,
        default: () => '\'0\'',
        name: 'model_id',
        })
    model_id: number;

    @Column('int', {
        nullable: false,
        default: () => '\'0\'',
        name: 'parent_id',
        })
    parent_id: number;

    @Column('varchar', {
        nullable: false,
        length: 30,
        name: 'name',
        })
    name: string;

    @Column('varchar', {
        nullable: false,
        length: 100,
        name: 'image',
        })
    image: string;

    @Column('enum', {
        nullable: true,
        name: 'flag',
        })
    flag: string | null;

    @Column('varchar', {
        nullable: false,
        name: 'keywords',
        })
    keywords: string;

    @Column('varchar', {
        nullable: false,
        name: 'description',
        })
    description: string;

    @Column('varchar', {
        nullable: false,
        unique: true,
        length: 30,
        name: 'diyname',
        })
    diyname: string;

    @Column('varchar', {
        nullable: false,
        name: 'outlink',
        })
    outlink: string;

    @Column('mediumint', {
        nullable: false,
        default: () => '\'0\'',
        name: 'items',
        })
    items: number;

    @Column('int', {
        nullable: false,
        default: () => '\'0\'',
        name: 'weigh',
        })
    weigh: number;

    @Column('varchar', {
        nullable: false,
        length: 100,
        name: 'channeltpl',
        })
    channeltpl: string;

    @Column('varchar', {
        nullable: false,
        length: 100,
        name: 'listtpl',
        })
    listtpl: string;

    @Column('varchar', {
        nullable: false,
        length: 100,
        name: 'showtpl',
        })
    showtpl: string;

    @Column('smallint', {
        nullable: false,
        default: () => '\'0\'',
        name: 'pagesize',
        })
    pagesize: number;

    @Column('tinyint', {
        nullable: false,
        width: 1,
        default: () => '\'0\'',
        name: 'iscontribute',
        })
    iscontribute: boolean;

    @Column('tinyint', {
        nullable: false,
        width: 1,
        default: () => '\'1\'',
        name: 'isnav',
        })
    isnav: boolean;

    @Column('int', {
        nullable: true,
        name: 'createtime',
        })
    createtime: number | null;

    @Column('int', {
        nullable: true,
        name: 'updatetime',
        })
    updatetime: number | null;

    @Column('enum', {
        nullable: false,
        default: () => '\'normal\'',
        enum: ['normal', 'hidden'],
        name: 'status',
        })
    status: string;

}
